const NodeMediaServer = require('node-media-server');

const config = {
    rtmp: {
        port: 1935,
        chunk_size: 60000,
        gop_cache: true,
        ping: 30,
        ping_timeout: 60
    },
    http: {
        port: 8000,
        allow_origin: '*'
    }
};

var nms = new NodeMediaServer(config)
nms.run();

/*{"live":{"123456":{"publisher":{"app":"live","stream":"123456","clientId":"D6VYMLV6","connectCreated":"2020-09-29T03:01:46.758Z","bytes":15670910,"ip":"::ffff:127.0.0.1","audio":{"codec":"AAC","profile":"LC","samplerate":44100,"channels":2},"video":{"codec":"H264","width":1280,"height":720,"profile":"High","level":3.1,"fps":30}},"subscribers":[{"app":"live","stream":"123456","clientId":"KPCK02ZN","connectCreated":"2020-09-29T03:02:35.197Z","bytes":2784456,"ip":"::1","protocol":"http"}]}}} */